package com.webvihar.common.utils;

import android.util.Log;

/**
 * Logger.java
 * 
 * @author Viswanath Kumar Sandu
 */
public class Logger {
	public static final String LOG_TAG = "A2Db";
	
	public static void logInfo(String tag, String msg) {
		Log.d(tag, msg);
	}

	public static void logError(String tag, String msg, Exception... optional) {
		Exception e = optional == null || optional.length == 0 ? null : optional[0];
		if (e == null) {
			Log.e(tag, String.format("%s  Error message = %s  Exception e is null.  ", msg, ""));
		}
		else {
			Log.e(tag, String.format("%s  Error message = %s", msg, e.getCause() == null ? e.getMessage() : e.getCause().getMessage()));
		}
	}
}
